
<!--div id="container" class="mainContainer"-->
<div id="manageLayerFormContainer">
    <div style="clear:both"></div>
    <?php echo form_open(base_url().'manageLayer/perform', 'id="manageLayerForm"'); ?>


    <?php
    echo form_hidden('WMSURL', $WMSURL);
    $srsArray = array();
    $i = 0;
    foreach ($srss as $srs) {
        $srsArray[$i] = $srs['name'];
        $i++;
    }

    echo form_hidden('srss', $srsArray);
    echo form_hidden('isUpdate', $isUpdate);
    echo form_hidden('layerWMS', $layer);
    echo form_hidden('metatileXSelected',$metatileXSelected);
    echo form_hidden('metatileYSelected',$metatileYSelected);
    
    echo '<div class="line manageLayerFieldGroup">';
    echo form_label('Nombre: ', 'layerWMTS');
    echo form_input('layerWMTS', $layer, 'id="layerWMTS"');

    echo '<span class="validationFieldErrorMessage">';
    echo form_error('layerWMTS');
    echo '</span>';

    echo '</div>';
    echo '<div class="line manageLayerFieldGroup">';
    echo form_label('Formato : ', 'tileFormat');
    echo form_dropdown('tileFormat', $tileImageFormats, $tileImageFormatsSelected === null ? '' : $tileImageFormatsSelected, 'id="tileFormat"');
    echo form_label('Metatile : ', 'metatileX');
    echo form_dropdown('metatileX', $metatileX, $metatileXSelected === null ? '' : $metatileXSelected, 'id="metatileX"');
    echo form_dropdown('metatileY', $metatileY, $metatileYSelected === null ? '' : $metatileYSelected, 'id="metatileY"');
    echo '</div>';
    echo '<div class="line manageLayerFieldGroup">';
    echo form_label('Transparencia: ', 'transparentOption');
    echo form_checkbox($trasparentOption);
    echo form_label('GetFeatureInfo: ', 'enablefeature');
    echo form_checkbox($enableFeature);
    ?>
    <div id="avancedOptions" class="line manageLayerFieldGroup">
        <h3> Opciones avanzadas </h3>
        <?php echo form_fieldset('Tiempo de Expiración (segundos)'); ?>
        <p>

            <?php
            echo form_label('Cliente : ', 'expires');
            echo form_input('expires', $expires, 'id="expires"');
            echo form_label('Caché : ', 'autoExpires');
            echo form_input('autoExpires', $autoExpires, 'id="autoExpires"');
            ?>

        </p>
        <?php echo form_fieldset_close();
        ?>
    </div>
    <?php
    echo '</div>';
    ?>

    <?php
    echo '<div id="tabs-srs" class="srs-tabs">';
    echo '<ul>';
    foreach ($srss as $srs) {
        echo '<li><a href="#tab-' . $srs['name'] . '">' . $srs['name'] . '</a></li>';
    }
    foreach ($srss as $srs) {
        echo '<div id="tab-' . $srs['name'] . '">';
        echo '<div class="tab-container">';

        echo '<div class="line">';

        echo form_label('Configurar este SRS : ', $srs['toggleSRS']['id']);
        echo form_checkbox($srs['toggleSRS']);
        echo '</div>';

        echo '<div class="line">';
        echo form_label("Limitar Bounding Box", $srs['limitBbox']['id']);
        echo form_checkbox($srs['limitBbox']);
        echo '</div>';

        echo '<div class="line">';
        echo form_input($srs['bboxMinX']);
        echo form_input($srs['bboxMinY']);
        echo form_input($srs['bboxMaxX']);
        echo form_input($srs['bboxMaxY']);
        echo anchor_popup('regionBoundingBox/index/' . urlencode($srs['name']), 'Buscar región', $regionPopUpAttr);
        echo '</div>';

        echo '<div class="line">';
        echo form_label("Limitar niveles de zoom", $srs['limitZoomLevels']['id']);
        echo form_checkbox($srs['limitZoomLevels']);
        echo form_label('Desde : ', 'minZoomLevel-"' . $srs['name']);
        echo form_dropdown('minZoomLevel-' . $srs['name'], $srs['minZoomLevel'], $srs['minZoomLevelSelected'], 'id="minZoomLevel-' . $srs['name'] . '"');
        echo form_label('Hasta : ', 'maxZoomLevel' . $srs['name']);
        echo form_dropdown('maxZoomLevel-' . $srs['name'], $srs['maxZoomLevel'], $srs['maxZoomLevelSelected'], 'id="maxZoomLevel-' . $srs['name'] . '"');

        echo '</div>';
        echo '</div>';
        echo '</div>';
    }

    echo '</ul>';
    echo '</div>';
    ?>
    <div id="validationErrors" >
        <span class="validationFieldErrorMessage">
            <?php echo form_error('WMSURL'); ?> 
        </span>
    </div>
    <div id="manageLayerFormControls">
        <?php echo form_submit('submit', 'Aceptar'); ?>
        <input value="Cancelar" type="button" id="cancelManageLayer">
        <?php echo form_close(); ?>   
    </div>




</div>
<!--/div-->



